package de.wesemann.jdedun.entities;

import java.net.URL;

public class Paging {

    private URL next;
    private URL previous;

    /**
     * @param next
     *            the next to set
     */
    public void setNext(URL next) {
	this.next = next;
    }

    /**
     * @return the next
     */
    public URL getNext() {
	return next;
    }

    /**
     * @param previous
     *            the previous to set
     */
    public void setPrevious(URL previous) {
	this.previous = previous;
    }

    /**
     * @return the previous
     */
    public URL getPrevious() {
	return previous;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((next == null) ? 0 : next.hashCode());
	result = prime * result
		+ ((previous == null) ? 0 : previous.hashCode());
	return result;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
	if (this == obj) {
	    return true;
	}
	if (obj == null) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	Paging other = (Paging) obj;
	if (next == null) {
	    if (other.next != null) {
		return false;
	    }
	} else if (!next.equals(other.next)) {
	    return false;
	}
	if (previous == null) {
	    if (other.previous != null) {
		return false;
	    }
	} else if (!previous.equals(other.previous)) {
	    return false;
	}
	return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
	return "Paging [next=" + next + ", previous=" + previous + "]";
    }

}
